package com.homework9;

import java.io.*;
import java.net.Socket;
import java.util.UUID;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",8888);
        BufferedInputStream bufferedInputStream = new BufferedInputStream(socket.getInputStream());
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File("C:\\Users\\admin\\Desktop\\" + System.currentTimeMillis() + ".jpg")));
        int len;
        byte[] bytes=new byte[8192];
        while ((len=bufferedInputStream.read(bytes))!=-1){
            bufferedOutputStream.write(bytes,0,len);
        }

    }
}
